import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      meta:{hidden:true},
      // component: ()=> import ('@/page/home/index.vue')
      redirect:'/home'
    },
    {
      path: '/layout',
      meta:{footerNav:true},
      component: ()=> import ('@/components/layout/index.vue'),
      children:[
          {
            path: '/home',
            meta:{footer:true,title:'首页',nowIndex:0},
            component: ()=> import ('@/page/home/index.vue')
          },
          {
            path: '/classfy',
            name:"DataList",
            meta:{footer:true,title:'分类',nowIndex:1},
            component: ()=> import ('@/page/classfy/index.vue')
          },
          {
            path: '/order',
            meta:{footer:true,title:'订单',nowIndex:2},
            component: ()=> import ('@/page/order/index.vue')
          },
          {
            path: '/my',
            meta:{footer:true,title:'我的',nowIndex:3},
            component: ()=> import ('@/page/my/index.vue')
          }
      ]
    },
    {
      path: '/search',
      meta:{footer:true,nowIndex:1},
      component: ()=> import ('@/page/classfy/search.vue')
    },
    {
      path: '/shopList',
      name:"ShopList",
      meta:{footer:true,nowIndex:1},
      component: ()=> import ('@/page/classfy/shopList.vue')
    }
  ]
})
